package com.wyx.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.wyx.service.FeignProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private FeignProductService fs;
    @GetMapping("/select")
    @HystrixCommand(fallbackMethod = "getHystrixInfo")
    public String select(){
        String s = fs.select();
        return "我是订单的查询所有"+s;
    }
    public String getHystrixInfo(){
        return "熔断开启，禁止请求";
    }
}
